﻿@using A2.ERP.Models
@{
    List<p_ProductsStock_getDataSetByProductsID_Result> ProductsStocklist = ViewBag.ProductsStock;
}
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>StockViewModule</title>
</head>
<body>
    <div id="StockProductsView">
        <div class="card">
            <div class="card-header">
                仓库分布情况
            </div>
            <div class="card-body">
                <div class="Stock-top" style="padding-top: 15px; padding-left: 15px;">
                    <div class="input-group mb-3" style="width: 200px;float:left;">
                        <div class="input-group-prepend">
                            <span class="input-group-text">
                                商品编号
                            </span>
                        </div>
                        <input type="text" id="InventoryID" class="form-control"  aria-label="Username" aria-describedby="basic-addon1">
                    </div>
                    <input class="btn btn-primary btnSearch ProductsIDSearch" type="submit" value="搜索">
                </div>
            </div>
        </div>
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>商品名称</th>
                    <th>库房</th>
                    <th>库区</th>
                    <th>现存量</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in ProductsStocklist)
                {
                    <tr>
                        <td>
                            @item.ProductsName
                        </td>
                        <td>
                            @item.HouseName
                        </td>
                        <td>
                            @item.SubareaName
                        </td>
                        <td>
                            @item.Num
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <script>
        $(function () {

            var $InventorySearch = $(".ProductsIDSearch");

            $InventorySearch.on('click', function (e) {

                $tab.reloadTab('#StockProductsView', [{ ProductsID: $('#InventoryID').val() }]);
            });

        });
    </script>
</body>
</html>
